import junit.framework.TestCase;

/**
 * Class to make tests of the Bill class
 * @author JESUS
 *
 */
public class BillTest extends TestCase {

	Bill TestBill = new Bill();
	
	/**
	 * Test method for {@link Bill#TotalBill()}.
	 */
	public void testTotalBill() {
		TestBill.AddProduct(new Product("Chorizo", 0.6f, 2));
		TestBill.AddProduct(new Product("Jamon", 1f, 3));
		
		assertEquals("Checking totals", TestBill.TotalBill(),4.2, 3);
		
	}

	/**
	 * Test method for {@link Bill#AddIVA(float)}.
	 */
	public void testAddIVA() {
		TestBill.AddProduct(new Product("Chorizo", 0.6f, 2));
		TestBill.AddProduct(new Product("Jamon", 1f, 3));
		
		assertEquals("Checking IVA", TestBill.AddIVA(0.5f),2.1,0.1);
	}

}
